package com.fesine.ch02.t5;

/**
 * @Author: Fesine
 * @CreateDate:2016/6/30
 * @UpdateUser:修改人名称
 * @UpdateDate:2016/6/30
 * @UpdateRemark:修改具体的内容
 */
public class Task {
    private String getData1;
    private String getData2;
    public synchronized void doLongTimeTask(){

        try {
            System.out.println("begin task");
            Thread.sleep(3000);
            getData1 = "长时间处理任务后从远程返回的值1 threadName="+Thread.currentThread().getName();
            getData2 = "长时间处理任务后从远程返回的值2 threadName="+Thread.currentThread().getName();
            System.out.println(getData1);
            System.out.println(getData2);
            System.out.println("begin end");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
